<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Менеджер фотографий
 *
 * @version 1.0 alpha 3
 * @package JoiGallery
 * @subpackage	AdminView
 * @filename photos.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
 
defined('_VALID_MOS') or die();


?>

	<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
		  <th class="categories"><?php echo _C_JOIGALLERY_PHOTO_MANAGER ?></th>
		  <td nowrap="nowrap"><?php echo _C_JOIGALLERY_CAT ?> <?php echo $lists['cid']; ?></td>
	  </tr>
	  </table>
	  <table class="adminlist">
		<tr>
			<th width="10" align="left">#</th>
			<th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows );?>);" /></th>
			<th class="title"><?php echo _C_JOIGALLERY_PHOTO_NAME ?></th>
			<th colspan="2" width="5%"><?php echo _C_JOIGALLERY_CAT_REORDER ?></th>
			<th width="2%"><?php echo _C_JOIGALLERY_CAT_ORDER ?></th>
			<th width="1%"><a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a></th>
			<th class="title"><?php echo _C_JOIGALLERY_PHOTO_CAT ?></th>
			<th class="title" width="75"><?php echo _C_JOIGALLERY_PHOTO_THUMB_CAT ?></th>
			<th class="title" width="75"><?php echo _C_JOIGALLERY_CAT_PUB ?></th>
			<th></th>
		</tr>
		<?php
		$k = 0;
		for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row 	= &$rows[$i];

			$link = 'index2.php?option='. $option . '&act=photos&task=edit&hidemainmenu=1&cid='. $row->id;
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $pageNav->rowNumber( $i ); ?></td>
				<td><?php echo mosHTML::idBox($i, $row->id); ?></td>
				<td>
				  <a href="<?php echo $link; ?>">
				  <?php echo  $row->name ; ?>
				  </a>
				</td>
				<td><?php echo $pageNav->orderUpIcon( $i ); ?></td>
				<td><?php echo $pageNav->orderDownIcon( $i, $n ); ?></td>
				<td align="center" colspan="2"><input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" /></td>
				<td><?php echo $row->category; ?></td>
				<td><?php echo ($row->default ? '<img src="images/tick.png" border="0" />' : ''); ?></td>
				<td>
				  <a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $row->state ? 'unpublish' : 'publish'; ?>')">
				  <img src="images/<?php echo $row->state ? "tick.png" : "publish_x.png"; ?>" border="0" />
				  </a>
				</td>
				<td></td>
			</tr>
			<?php
			
			$k = 1 - $k;
		}
		?>
		</table>

		<?php echo $pageNav->getListFooter(); ?>

		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="act" value="photos" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>